let button = $("button")
let tc = $(".tc")
let h1 = $(".tc h1")
let tj = $(".tj")
let zh = $("#zh")
// 二维码登录
let sm = $(".sm")
let smbtn = $("#sm")

console.log(tc)
console.log(h1)
console.log(tj)
console.log(smbtn)
function tm() {
    window.setTimeout(function () {
        tc.style.opacity = "0";
    }, 2000)
}

// smbtn.addEventListener("click",function(){
//     sm.style.display=" block"
//     tj.style.display=" none"
//     smbtn.style.color="black"
//    
// })

// zh.addEventListener("click",function(){
//     sm.style.display="none"
//     tj.style.display="block"
//     smbtn.style.color="#00a7f2"
//     zh.style.color="black"
// })

$(".log-zc a").forEach(function(v,i){
    v.addEventListener("click",function(){
        $(".log-zc a").forEach(function (item) {
            item.classList.remove("act");
        });
        // 4.再给当前被点击的对象增加激活样式
        this.classList.add("act");
    $(".fom form").forEach(function(each){
        each.style.display = "none"
        })

        $(".fom form")[i].style.display = "block"
    })
    $(".fom form")[0].style.display = "block"
    })
button.addEventListener("click", function () {
    let password = $("#password")
    let username = $("#username")
    let nameValue = username.value
    let passValue = password.value
    console.log(username);
    console.log(password);
    console.log(button);
    if (nameValue === "" || passValue === "") {
        tc.style.opacity = "1";
        h1.innerHTML = "账号或密码不能为null"
        tm()

    }
    else if (nameValue === "12345678" || passValue === "12345678") {
        tc.style.opacity = "1";
        h1.innerHTML = "登录成功"
        tm()
    }
    else {
        tc.style.opacity = "1";
        h1.innerHTML = "账号或密码错误!"
        tm()
    }

})